{extend name='extra@admin/content'}

{block name="button"}
<div class="nowrap pull-right" style="margin-top:10px">

</div>
{/block}

{block name="content"}

<!-- 表单搜索 开始 -->

<!-- 表单搜索 结束 -->

<form onsubmit="return false;" data-auto="true" method="post">
    <input type="hidden" value="resort" name="action"/>
    <table class="layui-table" lay-skin="line" lay-size="sm">
        <thead>
            <tr>
                <th class='text-left nowrap'>ID</th>
                <th class='text-left nowrap'>推荐位</th>
                <th class='text-left nowrap'>推荐分类</th>
                <th class='text-left nowrap'>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class='text-left nowrap'>
                    1
                </td>
                <td class='text-left nowrap'>
                    推荐位一
                </td>
                <td class='text-left nowrap'>
                    {if condition="!empty($recommend_category_1)"}
                        <span class="text-explode">|</span>
                        {$recommend_category_1.title}
                        {if auth("$classuri/set_recommend_category")}
                        <span class="text-explode">|</span>
                        <a data-modal='{:url("$classuri/set_recommend_category")}?id={$recommend_category_1.id}&p_id=1' href="javascript:void(0)">设置</a>
                        {/if}
                    {else /}
                        <span class="text-explode">|</span>
                        暂未设置
                        {if auth("$classuri/set_recommend_category")}
                            <span class="text-explode">|</span>
                            <a data-modal='{:url("$classuri/set_recommend_category")}?id=0&p_id=1' href="javascript:void(0)">设置</a>
                        {/if}
                    {/if}
                </td>
                <td class='text-left nowrap'>
                    {if auth("$classuri/edit_recommend_category")}
                        <span class="text-explode">|</span>
                        <a data-modal='{:url("$classuri/edit_recommend_category")}?id={$recommend_category_1.id}' href="javascript:void(0)">编辑</a>
                    {/if}

                    {if condition="!empty($recommend_category_1)"}
                        {if auth("$classuri/set_recommend_category")}
                            <span class="text-explode">|</span>
                            <a data-open='{:url("$classuri/recommend_goods_list")}?id={$recommend_category_1.cate_id}' href="javascript:void(0)">推荐商品</a>
                        {/if}
                    {else /}
                        请先设置推荐分类
                    {/if}
                </td>
            </tr>
            <tr>
                <td class='text-left nowrap'>
                    2
                </td>
                <td class='text-left nowrap'>
                    推荐位二
                </td>
                <td class='text-left nowrap'>
                     {if condition="!empty($recommend_category_2)"}
                        <span class="text-explode">|</span>
                        {$recommend_category_2.title}
                        {if auth("$classuri/set_recommend_category")}
                        <span class="text-explode">|</span>
                        <a data-modal='{:url("$classuri/set_recommend_category")}?id={$recommend_category_2.id}&p_id=2' href="javascript:void(0)">设置</a>
                        {/if}
                    {else /}
                        <span class="text-explode">|</span>
                        暂未设置
                        {if auth("$classuri/set_recommend_category")}
                            <span class="text-explode">|</span>
                            <a data-modal='{:url("$classuri/set_recommend_category")}?id=0&p_id=2' href="javascript:void(0)">设置</a>
                        {/if}
                    {/if}
                </td>
                <td class='text-left nowrap'>
                    {if auth("$classuri/edit_recommend_category")}
                        <span class="text-explode">|</span>
                        <a data-modal='{:url("$classuri/edit_recommend_category")}?id={$recommend_category_2.id}' href="javascript:void(0)">编辑</a>
                    {/if}
                    {if condition="!empty($recommend_category_2)"}
                        {if auth("$classuri/set_recommend_category")}
                            <span class="text-explode">|</span>
                            <a data-open='{:url("$classuri/recommend_goods_list")}?id={$recommend_category_2.cate_id}' href="javascript:void(0)">推荐商品</a>
                        {/if}
                    {else /}
                        请先设置推荐分类
                    {/if}
                </td>
            </tr>
        </tbody>
    </table>

    <script>
        window.laydate.render({range: true, elem: '#range-date', format: 'yyyy/MM/dd'});
        layui.use('form', function(){
            var form = layui.form;      //只有执行了这一步，部分表单元素才会自动修饰成功
            form.render();
        });
    </script>

</form>
{/block}